<template>
    <div class="finish_box">
      <!-- 面包屑盒子 -->
      <div class="bread">
        <span>统计分析</span> >
        <span>盘点详情</span>
      </div>
      <div style="margin-top: 20px;">
        <h3 >xxxx盘点详情</h3>
        <div style="margin-top: 20px;">
          <el-table :data="detailData_pan" border style="width: 100%" :row-style="{height:50+'px'}">
            <el-table-column prop="facilityEncoding" label="编码" width="180">
            </el-table-column>
            <el-table-column prop="className" label="分类" width="180">
            </el-table-column>
            <el-table-column prop="facilityName" label="名称"> </el-table-column>
            <el-table-column prop="facilityAmount" label="库存数量">
            </el-table-column>
            <el-table-column prop="facilityPrice" label="单价（元）">
            </el-table-column>
            <el-table-column prop="actualCheckNum" label="实际盘点数">              
            </el-table-column>
            <el-table-column  label="盘点-库存">
            <template slot-scope="scope" >
              {{ scope.row.facilityAmount-scope.row.actualCheckNum }}
            </template>
          </el-table-column>
          <el-table-column  label="盈亏值">
            <template slot-scope="scope">
              {{ (scope.row.facilityAmount-scope.row.actualCheckNum)*scope.row.facilityPrice }}
            </template>
          </el-table-column>
          </el-table>
        </div>
      </div>
    </div>
  </template>
  <script>
  // import { query } from "express";
  import statistics_serive from "../../serive/statistics";
  export default {
    name: "pan_start",
    data() {
      return {
        // 盘点详情列表
        detailData_pan: [],
        panNum:''
      };
    },
    mounted() {
      console.log("id", this.$route.query);
      console.log('1');
      let id = this.$route.query.id;
      this.id = id
      statistics_serive.start_pan(id).then((res) => {
        // console.log('1',res.data.data);
      });
  
      statistics_serive.detail_pan(id, 50, 1).then((res) => {
        console.log("详情", res.data.data);
        this.detailData_pan = res.data.data;
      });
    },
    methods: {
      
      finish_pan() {
        let params = {id:this.id,time:''}
        console.log(this.id);
        statistics_serive.finish_pan(this.id).then((res) => {
          console.log(res.data.data);
      });
      },
    },
  };
  </script>
  <style>
  .finish_box {
    overflow-y: auto;
    height: 600px;
    width: 100%;
    padding: 30px;
  }
  .bread {
    margin-left: 20px;
    padding-top: 20px;
  }
  </style>